package com.example.lin.togglebutton;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Toast;

import com.example.lin.togglebutton.view.ToggleButtonPlus;
import com.example.lin.togglebutton.view.ToggleButtonPlusMax;

public class MainActivity extends AppCompatActivity {


    private ToggleButtonPlusMax tbp;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tbp = findViewById(R.id.tbp);
        tbp.setToggle(true);
        tbp.setOnToggleListener(new ToggleButtonPlusMax.OnToggleListener() {
            @Override
            public void onToggle(boolean toggle) {
                Toast.makeText(MainActivity.this, "" + toggle, Toast.LENGTH_SHORT).show();
            }
        });

    }

}
